<?php

  //////////////////////////////////////////////////////////////////
  // OrbitFAQ                                                     //
  // ---------                                                    //
  //                                                              //
  // Orbit FAQ was solely written and developed by Orbit Services //
  // http://www.orbitservices.net                                 //
  //                                                              //
  // OrbitFAQ utilises the following opensource projects/classes; //
  //  + Fckeditor - http://www.fckeditor.net                      //
  //  + Smarty Template Engine - http://smarty.php.net            //
  //  + Swift Email Class - http://www.swift.com                  //
  //  + OWASP PHP Filter Project - http://www.owasp.org           //
  //  + MySQL Search Class by Stephen Bartholomew                 //
  //                                                              //
  //////////////////////////////////////////////////////////////////

  // Database Class to assist in making OrbitFAQ non DB specific

if($dbType == 'mysql')
  {
    $faqsql_connect = 'mysql_connect';
    $faqsql_select_db = 'mysql_select_db';
    $faqsql_query = 'mysql_query';
    $faqsql_fetch_array = 'mysql_fetch_array';
    $faqsql_count_rows = 'mysql_num_rows';
    $faqsql_rand_before_column = '';
    $faqsql_rand = 'RAND() LIMIT 1';
    $faqsql_insertid = 'mysql_insert_id';
  }
elseif($dbType == 'mssql')  // Not Tested Yet!!
  {
    $faqsql_connect = 'mssql_connect';
    $faqsql_select_db = 'mssql_select_db';
    $faqsql_query = 'mssql_query';
    $faqsql_fetch_array = 'mssql_fetch_array';
    $faqsql_count_rows = 'mssql_num_rows';
    $faqsql_rand_before_column = 'TOP 1';
    $faqsql_rand = 'newid()';
    $faqsql_insertid = 'TBA';
  }
else
  {
    echo "You have not selected a valid Database Type check your <b>config.ing.php</b>";
    exit;
  }

/*

FOR FUTURE REFERENCE..

Select a random row with PostgreSQL:

SELECT column FROM table
ORDER BY RANDOM()
LIMIT 1

Select a random row with Microsoft SQL Server:

SELECT TOP 1 column FROM table
ORDER BY NEWID()

Select a random row with IBM DB2

SELECT column FROM table
ORDER BY RAND()
FETCH FIRST 1 ROWS ONLY

Thanks Tim
Select a random record with Oracle:

SELECT column FROM
( SELECT column FROM table
ORDER BY dbms_random.value )
WHERE rownum = 1


*/

// Make connection with DB
$dbc = $faqsql_connect ($db_hostname, $db_user, $db_pass) OR DIE( $sql_host_error );
$faqsql_select_db ($db_database) OR DIE( $sql_db_error );

?>